﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Academia.Properties;
using System.Data.OleDb;
using Academia.Classes;

namespace Academia
{
    public partial class AlunoBusca : Form
    {
        public AlunoBusca()
        {
            InitializeComponent();
        }

        private void AlunoBusca_Load(object sender, EventArgs e)
        {
            OleDbConnection conn = new OleDbConnection(Settings.Default.ConnString);
            OleDbCommand query = new OleDbCommand("Select * from Alunos", conn);
            conn.Open();
            OleDbDataReader reader =  query.ExecuteReader();
            List<Aluno> alunos = CarregaLista(reader);
            conn.Close();
            
        }

        private List<Aluno> CarregaLista(OleDbDataReader reader)
        {
            List<Aluno> alunos = new List<Aluno>();
            Aluno aluno;
            while (reader.Read()) 
            {
                aluno = new Aluno();
                aluno.Nome = reader["Nome"].ToString();
                aluno.
                
            }
        }
    }
}
